import { LOGIN, LOGOUT } from "../constanst/login";

const initValue = {
  token: ''
}
export default function login(state = initValue, action) {
  switch (action.type) {
    case LOGIN:
      return {
              ...state,
              token:action.payload
            };
    case LOGOUT:
      return {
              ...state,
              token:''
            };
    default:
      return state;
    }
}